3.188 \(\int \cot (e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=26 \[ \frac {a \log (\sin (e+f x))}{f}-\frac {b \log (\cos (e+f x))}{f} \]

[Out]

-b*ln(cos(f*x+e))/f+a*ln(sin(f*x+e))/f

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3625, 3475} \[ \frac {a \log (\sin (e+f x))}{f}-\frac {b \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((b*Log[Cos[e + f*x]])/f) + (a*Log[Sin[e + f*x]])/f

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3625

Int[((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Dist[A, Int[1/Tan[e + f*x],
 x], x] + Dist[C, Int[Tan[e + f*x], x], x] /; FreeQ[{e, f, A, C}, x] && NeQ[A, C]

Rubi steps

\begin {align*} \int \cot (e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=a \int \cot (e+f x) \, dx+b \int \tan (e+f x) \, dx\\ &=-\frac {b \log (\cos (e+f x))}{f}+\frac {a \log (\sin (e+f x))}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 34, normalized size = 1.31 \[ \frac {a (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}-\frac {b \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((b*Log[Cos[e + f*x]])/f) + (a*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/f

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 46, normalized size = 1.77 \[ \frac {a \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - b \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*(a*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1)) - b*log(1/(tan(f*x + e)^2 + 1)))/f

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)1/f*(a/2*ln(sin(f*x+exp(1))^2)-b/2*ln(abs(sin(f*x+exp(1))^2-1)
))

________________________________________________________________________________________

maple [A]  time = 0.57, size = 27, normalized size = 1.04 \[ -\frac {b \ln \left (\cos \left (f x +e \right )\right )}{f}+\frac {a \ln \left (\sin \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)*(a+b*tan(f*x+e)^2),x)

[Out]

-b*ln(cos(f*x+e))/f+a*ln(sin(f*x+e))/f

________________________________________________________________________________________

maxima [A]  time = 0.63, size = 31, normalized size = 1.19 \[ -\frac {b \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - a \log \left (\sin \left (f x + e\right )^{2}\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(b*log(sin(f*x + e)^2 - 1) - a*log(sin(f*x + e)^2))/f

________________________________________________________________________________________

mupad [B]  time = 11.66, size = 36, normalized size = 1.38 \[ \frac {a\,\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a}{2}-\frac {b}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)*(a + b*tan(e + f*x)^2),x)

[Out]

(a*log(tan(e + f*x)))/f - (log(tan(e + f*x)^2 + 1)*(a/2 - b/2))/f

________________________________________________________________________________________

sympy [A]  time = 0.41, size = 58, normalized size = 2.23 \[ \begin {cases} - \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a \log {\left (\tan {\left (e + f x \right )} \right )}}{f} + \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\relax (e )}\right ) \cot {\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((-a*log(tan(e + f*x)**2 + 1)/(2*f) + a*log(tan(e + f*x))/f + b*log(tan(e + f*x)**2 + 1)/(2*f), Ne(f,
 0)), (x*(a + b*tan(e)**2)*cot(e), True))

________________________________________________________________________________________